package com.dolphin.controller;

import jakarta.servlet.http.HttpSession;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class MyController {
    @GetMapping("/mylogin")
    public String login(HttpSession httpSession) {
        httpSession.setAttribute("logged", true);
        return "login";
    }
    //source1
    @GetMapping("/source/source1")
    public String source1() {
        return "source1";
    }
    //source2
    @GetMapping("/source/source2")
    public String source2() {
        return "source2";
    }

    //logout
    @GetMapping("/logout")
    public String logout(HttpSession httpSession) {
        httpSession.removeAttribute("logged");
        return "logout";
    }
}
